package com.dmwork.service.work.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dmwork.service.work.entity.Work;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dmwork.service.work.entity.vo.WorkBaseInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 李天
 * @since 2021-03-14
 */
@Mapper
@Repository
public interface WorkMapper extends BaseMapper<Work> {

    List<WorkBaseInfoVo> selectBaseInfoPage(Page<WorkBaseInfoVo> selectPage, @Param(Constants.WRAPPER) QueryWrapper<WorkBaseInfoVo> queryWrapper);

    List<WorkBaseInfoVo> getWorkBaseInfoListByIds(@Param(Constants.WRAPPER) QueryWrapper<WorkBaseInfoVo> queryWrapper);

    void increaseCollectCount(@Param("workId") String workId);

    void decreaseCollectCount(@Param("workId") String workId);
}
